FROM ubuntu:20.04

COPY sources.list /etc/apt/sources.list

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && \
apt install -y \
  make \
  build-essential \
  libclang-dev \
  ninja-build \
  gcc \
  git \
  bison \
  python3 \
  gperf \
  pkg-config \
  cmake \
  unzip \
  gfortran \
  subversion \
  nano \
  gcc-aarch64-linux-gnu \
  g++-aarch64-linux-gnu \
  gdb-multiarch \
  wget \
  flex \
  texinfo \
  gawk \
  openssl \
  pigz \
  libncurses-dev \
  tar \
  figlet \
  lsb-release 


# 将文件添加到相应目录下
COPY build_qt5_base.sh /usr/local/bin

RUN mkdir -p /build && \
  chmod +x /usr/local/bin/build_qt5_base.sh

# 添加Qt5.15.8源码，如果注释，后面编译脚本会从网络拉取
ADD qt-everywhere-opensource-src-5.15.8.tar.xz /opt

# 添加sysroot文件
ADD sysroot_ubuntu20.04.tar.gz /opt

# 切换当前工作目录
WORKDIR /build

# 指定默认命令
CMD ["/usr/local/bin/build_qt5_base.sh"]

